/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dto;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author glauco.24217
 */
@Entity
@Table(name = "aula")
@NamedQueries({
    @NamedQuery(name = "Aula.findAll", query = "SELECT a FROM Aula a"),
    @NamedQuery(name = "Aula.findById", query = "SELECT a FROM Aula a WHERE a.id = :id"),
    @NamedQuery(name = "Aula.findByDescricao", query = "SELECT a FROM Aula a WHERE a.descricao = :descricao"),
    @NamedQuery(name = "Aula.findByTurma", query = "SELECT a FROM Aula a WHERE a.turma = :turma"),
    @NamedQuery(name = "Aula.findByProfessor", query = "SELECT a FROM Aula a WHERE a.professor = :professor"),
    @NamedQuery(name = "Aula.findByGrade", query = "SELECT a FROM Aula a WHERE a.grade = :grade")})
public class Aula implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "descricao")
    private String descricao;
    @Basic(optional = false)
    @Column(name = "turma")
    private int turma;
    @Basic(optional = false)
    @Column(name = "professor")
    private int professor;
    @Basic(optional = false)
    @Column(name = "grade")
    private int grade;

    public Aula() {
    }

    public Aula(Integer id) {
        this.id = id;
    }

    public Aula(Integer id, String descricao, int turma, int professor, int grade) {
        this.id = id;
        this.descricao = descricao;
        this.turma = turma;
        this.professor = professor;
        this.grade = grade;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public int getTurma() {
        return turma;
    }

    public void setTurma(int turma) {
        this.turma = turma;
    }

    public int getProfessor() {
        return professor;
    }

    public void setProfessor(int professor) {
        this.professor = professor;
    }

    public int getGrade() {
        return grade;
    }

    public void setGrade(int grade) {
        this.grade = grade;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Aula)) {
            return false;
        }
        Aula other = (Aula) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "dto.Aula[id=" + id + "]";
    }

}
